home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbsrtpen.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-01-31  |  2.6 KB  |  61 lines

  1. (*===========================================================================*)
  2. (* Procedure to give status of channel queuing                               *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989, 1991 by H. Roy Engehausen.  All rights reserved.  *)
  5. (*                                                                           *)
  6. (*   This software may be freely distributed and used, but it may not        *)
  7. (*   under any circumstances be sold by anyone other than the author.        *)
  8. (*   It may be distributed by a commercial company as long as it is          *)
  9. (*   for no cost.                                                            *)
  10. (*                                                                           *)
  11. (*===========================================================================*)
  12.  
  13. (*===========================================================================*)
  14. (* Check pending                                                             *)
  15. (*                                                                           *)
  16. (*    Checks for pending data for this channel.   Used by PK232 to hold      *)
  17. (*    data received on wrong channel.  Used by MODEM to hold data since      *)
  18. (*    not host mode                                                          *)
  19. (*===========================================================================*)
  20.  
  21. FUNCTION  pending_chain(type_to_check : BYTE) : BYTE;
  22.  
  23.   VAR
  24.     i           : BYTE;
  25.     look_chain  : str_m_chain;
  26.  
  27.   BEGIN;
  28.  
  29.     look_chain := active_tcb^.tnc_in_chn;
  30.  
  31.     i := 0;
  32.  
  33.     (*-----------------------------------------------------------------------*)
  34.     (* Just search down the chain and see if we have an answer to the        *)
  35.     (* type of poll wanted                                                   *)
  36.     (*-----------------------------------------------------------------------*)
  37.  
  38.     WHILE (look_chain <> NIL) AND (i < 64) DO
  39.       BEGIN;
  40.  
  41.         {$IFDEF POINT_CHK}
  42.           test_pointer(look_chain);
  43.         {$ENDIF}
  44.  
  45.         IF (active_tcb^.channel = look_chain^.str_m_chan)
  46.                  AND ((type_to_check = 2)
  47.                       OR ((type_to_check = 3)
  48.                                  AND (look_chain^.str_m_type >= t_to_h_mh_noi))
  49.                       OR ((type_to_check = 4)
  50.                                  AND (look_chain^.str_m_type < t_to_h_mh_noi)))
  51.                  THEN
  52.           INC(i);
  53.  
  54.         look_chain := look_chain^.str_m_next;
  55.  
  56.       END;
  57.  
  58.     pending_chain := i;
  59.  
  60.   END;
  61.